package com.jsyxdl.utils;

import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject;

import java.io.UnsupportedEncodingException;

public class PropertiesMapperUtils {
    public static JSONObject getPropertiesMapper(String propertyPath) {
        String mapperStr = null;
        try {
            mapperStr = new String(
                    SpringUtil.getProperty(propertyPath).getBytes("ISO-8859-1"), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        if(mapperStr!=null){
            JSONObject jsonObject=JSONObject.parseObject(mapperStr);
            return jsonObject;
        }

        return null;
    }

}
